<template>
  <div class="swiper-container" ref="swipercontainer">
    <swiper :options="swiperOptions" class="swiper">
      <swiper-slide v-for="(img, index) in swiperImages" :key="index">
        <img :src="img" class="swiper-img" />
      </swiper-slide>
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
import { Swiper, SwiperSlide } from 'vue-awesome-swiper'
import 'swiper/css/swiper.css'
export default {
  name: 'classifySwiper',
  components: {
    Swiper,
    SwiperSlide,
  },
  data() {
    return {
      Swiper: null,
    }
  },
  data() {
    return {
      swiperOptions: {
        loop: true,
        autoplay: true,
        effect: 'fade',
        pagination: {
          el: '.swiper-pagination',
          clickable: true,
        },
      },
    }
  },
  props: {
    swiperImages: {
      type: Array,
      default() {
        return []
      },
    },
  },
}
</script>
<style scoped>
.swiper-container {
  width: 100%;
  --swiper-pagination-color: #ff5776; /* 两种都可以 */
}
.swiper {
  height: 300px;
}
.swiper-img {
  width: 100%;
}
</style>
